.class Lcom/waiqin365/base/view/q;
.super Ljava/lang/Object;

# interfaces
.implements Landroid/text/TextWatcher;


# instance fields
.field final synthetic a:Lcom/waiqin365/base/view/PhoneNumEditText;


# direct methods
.method constructor <init>(Lcom/waiqin365/base/view/PhoneNumEditText;)V
    .locals 0

    iput-object p1, p0, Lcom/waiqin365/base/view/q;->a:Lcom/waiqin365/base/view/PhoneNumEditText;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public afterTextChanged(Landroid/text/Editable;)V
    .locals 9

    const/4 v1, 0x0

    const/4 v8, 0x7

    const/4 v7, 0x3

    invoke-interface {p1}, Landroid/text/Editable;->length()I

    move-result v0

    if-lez v0, :cond_1

    iget-object v0, p0, Lcom/waiqin365/base/view/q;->a:Lcom/waiqin365/base/view/PhoneNumEditText;

    invoke-static {v0}, Lcom/waiqin365/base/view/PhoneNumEditText;->b(Lcom/waiqin365/base/view/PhoneNumEditText;)Landroid/widget/ImageView;

    move-result-object v0

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setVisibility(I)V

    :goto_0
    iget-object v0, p0, Lcom/waiqin365/base/view/q;->a:Lcom/waiqin365/base/view/PhoneNumEditText;

    invoke-static {v0}, Lcom/waiqin365/base/view/PhoneNumEditText;->c(Lcom/waiqin365/base/view/PhoneNumEditText;)Landroid/text/TextWatcher;

    move-result-object v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/waiqin365/base/view/q;->a:Lcom/waiqin365/base/view/PhoneNumEditText;

    invoke-static {v0}, Lcom/waiqin365/base/view/PhoneNumEditText;->c(Lcom/waiqin365/base/view/PhoneNumEditText;)Landroid/text/TextWatcher;

    move-result-object v0

    invoke-interface {v0, p1}, Landroid/text/TextWatcher;->afterTextChanged(Landroid/text/Editable;)V

    :cond_0
    :try_start_0
    iget-object v0, p0, Lcom/waiqin365/base/view/q;->a:Lcom/waiqin365/base/view/PhoneNumEditText;

    invoke-static {v0}, Lcom/waiqin365/base/view/PhoneNumEditText;->d(Lcom/waiqin365/base/view/PhoneNumEditText;)Z

    move-result v0

    if-eqz v0, :cond_2

    iget-object v0, p0, Lcom/waiqin365/base/view/q;->a:Lcom/waiqin365/base/view/PhoneNumEditText;

    const/4 v1, 0x0

    invoke-static {v0, v1}, Lcom/waiqin365/base/view/PhoneNumEditText;->a(Lcom/waiqin365/base/view/PhoneNumEditText;Z)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :goto_1
    return-void

    :cond_1
    iget-object v0, p0, Lcom/waiqin365/base/view/q;->a:Lcom/waiqin365/base/view/PhoneNumEditText;

    invoke-static {v0}, Lcom/waiqin365/base/view/PhoneNumEditText;->b(Lcom/waiqin365/base/view/PhoneNumEditText;)Landroid/widget/ImageView;

    move-result-object v0

    const/16 v1, 0x8

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setVisibility(I)V

    goto :goto_0

    :cond_2
    :try_start_1
    invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v3

    const-string/jumbo v2, ""

    const-string/jumbo v1, ""

    const-string/jumbo v0, ""

    if-eqz v3, :cond_c

    invoke-virtual {v3}, Ljava/lang/String;->length()I

    move-result v4

    if-lez v4, :cond_c

    const/4 v4, 0x0

    iget-object v5, p0, Lcom/waiqin365/base/view/q;->a:Lcom/waiqin365/base/view/PhoneNumEditText;

    invoke-static {v5}, Lcom/waiqin365/base/view/PhoneNumEditText;->e(Lcom/waiqin365/base/view/PhoneNumEditText;)I

    move-result v5

    iget-object v6, p0, Lcom/waiqin365/base/view/q;->a:Lcom/waiqin365/base/view/PhoneNumEditText;

    invoke-static {v6}, Lcom/waiqin365/base/view/PhoneNumEditText;->a(Lcom/waiqin365/base/view/PhoneNumEditText;)Landroid/widget/EditText;

    move-result-object v6

    invoke-virtual {v6}, Landroid/widget/EditText;->length()I

    move-result v6

    invoke-static {v5, v6}, Ljava/lang/Math;->min(II)I

    move-result v5

    invoke-virtual {v3, v4, v5}, Ljava/lang/String;->subSequence(II)Ljava/lang/CharSequence;

    move-result-object v4

    invoke-interface {v4}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;

    move-result-object v4

    const-string/jumbo v5, " "

    const-string/jumbo v6, ""

    invoke-virtual {v4, v5, v6}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/String;->length()I

    move-result v4

    const-string/jumbo v5, " "

    const-string/jumbo v6, ""

    invoke-virtual {v3, v5, v6}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/String;->length()I

    move-result v5

    if-lt v5, v7, :cond_8

    const/4 v2, 0x0

    const/4 v5, 0x3

    invoke-virtual {v3, v2, v5}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v2

    :cond_3
    :goto_2
    invoke-virtual {v3}, Ljava/lang/String;->length()I

    move-result v5

    if-lt v5, v8, :cond_9

    const/4 v0, 0x3

    const/4 v1, 0x7

    invoke-virtual {v3, v0, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v1

    const/4 v0, 0x7

    invoke-virtual {v3}, Ljava/lang/String;->length()I

    move-result v5

    invoke-virtual {v3, v0, v5}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v0

    :cond_4
    :goto_3
    new-instance v3, Ljava/lang/StringBuffer;

    invoke-direct {v3}, Ljava/lang/StringBuffer;-><init>()V

    if-eqz v2, :cond_5

    invoke-virtual {v2}, Ljava/lang/String;->length()I

    move-result v5

    if-lez v5, :cond_5

    invoke-virtual {v3, v2}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    invoke-virtual {v2}, Ljava/lang/String;->length()I

    move-result v2

    if-ne v2, v7, :cond_5

    const-string/jumbo v2, " "

    invoke-virtual {v3, v2}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    :cond_5
    if-eqz v1, :cond_6

    invoke-virtual {v1}, Ljava/lang/String;->length()I

    move-result v2

    if-lez v2, :cond_6

    invoke-virtual {v3, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    invoke-virtual {v1}, Ljava/lang/String;->length()I

    move-result v1

    const/4 v2, 0x4

    if-ne v1, v2, :cond_6

    const-string/jumbo v1, " "

    invoke-virtual {v3, v1}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    :cond_6
    if-eqz v0, :cond_7

    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result v1

    if-lez v1, :cond_7

    invoke-virtual {v3, v0}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    :cond_7
    const/4 v0, 0x2

    if-lt v4, v0, :cond_a

    if-ge v4, v8, :cond_a

    add-int/lit8 v0, v4, 0x2

    :goto_4
    iget-object v1, p0, Lcom/waiqin365/base/view/q;->a:Lcom/waiqin365/base/view/PhoneNumEditText;

    invoke-static {v1}, Lcom/waiqin365/base/view/PhoneNumEditText;->a(Lcom/waiqin365/base/view/PhoneNumEditText;)Landroid/widget/EditText;

    move-result-object v1

    invoke-virtual {v1, p0}, Landroid/widget/EditText;->removeTextChangedListener(Landroid/text/TextWatcher;)V

    iget-object v1, p0, Lcom/waiqin365/base/view/q;->a:Lcom/waiqin365/base/view/PhoneNumEditText;

    invoke-static {v1}, Lcom/waiqin365/base/view/PhoneNumEditText;->a(Lcom/waiqin365/base/view/PhoneNumEditText;)Landroid/widget/EditText;

    move-result-object v1

    invoke-virtual {v3}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V

    iget-object v1, p0, Lcom/waiqin365/base/view/q;->a:Lcom/waiqin365/base/view/PhoneNumEditText;

    invoke-static {v1}, Lcom/waiqin365/base/view/PhoneNumEditText;->a(Lcom/waiqin365/base/view/PhoneNumEditText;)Landroid/widget/EditText;

    move-result-object v1

    invoke-virtual {v1, v0}, Landroid/widget/EditText;->setSelection(I)V

    iget-object v0, p0, Lcom/waiqin365/base/view/q;->a:Lcom/waiqin365/base/view/PhoneNumEditText;

    invoke-static {v0}, Lcom/waiqin365/base/view/PhoneNumEditText;->a(Lcom/waiqin365/base/view/PhoneNumEditText;)Landroid/widget/EditText;

    move-result-object v0

    invoke-virtual {v0, p0}, Landroid/widget/EditText;->addTextChangedListener(Landroid/text/TextWatcher;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto/16 :goto_1

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    goto/16 :goto_1

    :cond_8
    :try_start_2
    invoke-virtual {v3}, Ljava/lang/String;->length()I

    move-result v5

    if-ge v5, v7, :cond_3

    const/4 v2, 0x0

    invoke-virtual {v3}, Ljava/lang/String;->length()I

    move-result v5

    invoke-virtual {v3, v2, v5}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v2

    goto/16 :goto_2

    :cond_9
    invoke-virtual {v3}, Ljava/lang/String;->length()I

    move-result v5

    if-le v5, v7, :cond_4

    invoke-virtual {v3}, Ljava/lang/String;->length()I

    move-result v5

    if-ge v5, v8, :cond_4

    const/4 v1, 0x3

    invoke-virtual {v3}, Ljava/lang/String;->length()I

    move-result v5

    invoke-virtual {v3, v1, v5}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v1

    goto/16 :goto_3

    :cond_a
    if-lt v4, v8, :cond_b

    add-int/lit8 v0, v4, 0x3

    goto :goto_4

    :cond_b
    add-int/lit8 v0, v4, 0x1

    goto :goto_4

    :cond_c
    iget-object v0, p0, Lcom/waiqin365/base/view/q;->a:Lcom/waiqin365/base/view/PhoneNumEditText;

    invoke-static {v0}, Lcom/waiqin365/base/view/PhoneNumEditText;->a(Lcom/waiqin365/base/view/PhoneNumEditText;)Landroid/widget/EditText;

    move-result-object v0

    invoke-virtual {v0, p0}, Landroid/widget/EditText;->removeTextChangedListener(Landroid/text/TextWatcher;)V

    iget-object v0, p0, Lcom/waiqin365/base/view/q;->a:Lcom/waiqin365/base/view/PhoneNumEditText;

    invoke-static {v0}, Lcom/waiqin365/base/view/PhoneNumEditText;->a(Lcom/waiqin365/base/view/PhoneNumEditText;)Landroid/widget/EditText;

    move-result-object v0

    const-string/jumbo v1, ""

    invoke-virtual {v0, v1}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V

    iget-object v0, p0, Lcom/waiqin365/base/view/q;->a:Lcom/waiqin365/base/view/PhoneNumEditText;

    invoke-static {v0}, Lcom/waiqin365/base/view/PhoneNumEditText;->a(Lcom/waiqin365/base/view/PhoneNumEditText;)Landroid/widget/EditText;

    move-result-object v0

    invoke-virtual {v0, p0}, Landroid/widget/EditText;->addTextChangedListener(Landroid/text/TextWatcher;)V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    goto/16 :goto_1
.end method

.method public beforeTextChanged(Ljava/lang/CharSequence;III)V
    .locals 2

    iget-object v0, p0, Lcom/waiqin365/base/view/q;->a:Lcom/waiqin365/base/view/PhoneNumEditText;

    iget-object v1, p0, Lcom/waiqin365/base/view/q;->a:Lcom/waiqin365/base/view/PhoneNumEditText;

    invoke-static {v1}, Lcom/waiqin365/base/view/PhoneNumEditText;->a(Lcom/waiqin365/base/view/PhoneNumEditText;)Landroid/widget/EditText;

    move-result-object v1

    invoke-virtual {v1}, Landroid/widget/EditText;->getSelectionStart()I

    move-result v1

    invoke-static {v0, v1}, Lcom/waiqin365/base/view/PhoneNumEditText;->a(Lcom/waiqin365/base/view/PhoneNumEditText;I)I

    iget-object v0, p0, Lcom/waiqin365/base/view/q;->a:Lcom/waiqin365/base/view/PhoneNumEditText;

    invoke-static {v0}, Lcom/waiqin365/base/view/PhoneNumEditText;->c(Lcom/waiqin365/base/view/PhoneNumEditText;)Landroid/text/TextWatcher;

    move-result-object v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/waiqin365/base/view/q;->a:Lcom/waiqin365/base/view/PhoneNumEditText;

    invoke-static {v0}, Lcom/waiqin365/base/view/PhoneNumEditText;->c(Lcom/waiqin365/base/view/PhoneNumEditText;)Landroid/text/TextWatcher;

    move-result-object v0

    invoke-interface {v0, p1, p2, p3, p4}, Landroid/text/TextWatcher;->beforeTextChanged(Ljava/lang/CharSequence;III)V

    :cond_0
    return-void
.end method

.method public onTextChanged(Ljava/lang/CharSequence;III)V
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/base/view/q;->a:Lcom/waiqin365/base/view/PhoneNumEditText;

    invoke-static {v0}, Lcom/waiqin365/base/view/PhoneNumEditText;->c(Lcom/waiqin365/base/view/PhoneNumEditText;)Landroid/text/TextWatcher;

    move-result-object v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/waiqin365/base/view/q;->a:Lcom/waiqin365/base/view/PhoneNumEditText;

    invoke-static {v0}, Lcom/waiqin365/base/view/PhoneNumEditText;->c(Lcom/waiqin365/base/view/PhoneNumEditText;)Landroid/text/TextWatcher;

    move-result-object v0

    invoke-interface {v0, p1, p2, p3, p4}, Landroid/text/TextWatcher;->onTextChanged(Ljava/lang/CharSequence;III)V

    :cond_0
    return-void
.end method
